/**
 * Created by V5470-I5 on 2016/4/8.
 */
public class Test {
    public static void main(String[] args){
        fun(100);
    }
    public static void fun(int n) {
        for (int i = 2, count = 0; i < n; i++) {
            boolean flag = true;
            for (int j = 2; j <= Math.sqrt(i); j++) {
                if (i % j == 0) {
                    flag = false;
                    break;}}
                if (flag == true) {
                    System.out.print(i + ",");
                    count++;
                }
                if (count % 5 == 0 && flag == true) {
                    System.out.println();
                }
            }
        }
    }